#!/bin/sh

. /etc/charon/hosts.sh

TMPFILE=/tmp/nslookup.$$

for host in www.paypalobjects.com www.paypal.com mikolaj.cx mikolaj.cc wiki.rcpt.to; do 
	if nslookup $host > $TMPFILE; then
		A=$(cat $TMPFILE | tail -1 | sed -e 's/^[^ ]* *//' -e 's/ //g')
		hostupdate $host $A
		echo $host $UPDATED
	fi
done

rm $TMPFILE

echo $UPDATED
[ x$UPDATED = xtrue ] && /etc/init.d/S47firewall-charon-prerouting start

